const MAX_TIME = 1500

const n = 8

const LEVEL_SCORE_LEVEL = [
  {
    n,
    time: 4000
  },
  {
    n,
    time: 3500
  },
  {
    n,
    time: 3000
  },
  {
    n,
    time: 2500
  },
  {
    n,
    time: 2000
  },
  {
    n,
    time: MAX_TIME
  }
]

let _levellist = []
export const initLevel = () => {
  _levellist = []
  for (const item of LEVEL_SCORE_LEVEL) {
    for (let i = 0; i < item.n; i++) {
      _levellist.push(item.time)
    }
    _levellist.push(0)
  }
  _levellist.pop()
}

export const nextLevelTime = () => {
  return _levellist.length ? _levellist.shift() : MAX_TIME
}